<template>
  <div>
    <div id="myChart1" style="width: 900px; height: 500px;margin:30px 300px"></div>
  </div>
</template>

<script>
import echarts from "echarts";
export default {
  methods: {
    drawChart() {
      var myChart = echarts.init(document.getElementById("myChart1"));
      var option = {
          title:{
              left: 'center',
              text: '2020-2021年中国各省确诊人数标准差'
          },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "shadow",
          },
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        xAxis: [
          {
            type: "category",
            data: ['Anhui',	'Beijing',	'Chongqing',	'Fujian',	'Gansu',	'Guangdong',	'Guangxi',	'Guizhou',	'Hainan',	'Hebei',	'Heilongjiang',	'Henan',	'Hong Kong',	'Hubei',	'Hunan',	'Inner Mongolia',	'Jiangsu',	'Jiangxi',	'Jilin',	'Liaoning',	'Macau',	'Ningxia',	'Qinghai',	'Shaanxi',	'Shandong',	'Shanghai',	'Shanxi',	'Sichuan',	'Tianjin',	'Xinjiang',	'Yunnan',	'Zhejiang'],
            axisTick: {
              alignWithLabel: true,
            },
          },
        ],
        yAxis: [
          {
            type: "value",
          },
        ],
        series: [
          {
            name: "标准差",
            type: "bar",
            barWidth: "60%",
            data: [123.6321546,245.515125,66.46453418,286.8775094,47.92969228,637.2187799,
            	39.18387673	,19.70915483,22.47274033,494.6923364,452.3190955,190.3310485,
                4729.753917,10055.16674,138.1990065,124.5148424,354.2257221,115.7313924,
                218.8020011,139.1574364,15.23524956,13.18626757,2.888320825,162.6649799,
                132.4156308,778.0701414,46.20848836,262.7940727,120.6377138,400.3802801	,
                434.4250528	,166.9490864]
          },
        ],
      };
      myChart.setOption(option);
    }
  },
  mounted() {
    this.drawChart();
  },
};
</script>

<style>
</style>